package com.xuan.singleton;

import com.xuan.singleton.eager.Singleton1;
import com.xuan.singleton.lazy.Singleton2;

public class Main {
    public static void main(String[] args) {
        System.out.println("singleton1 - 饿汉式单例");
        Singleton1 singleton11 = Singleton1.getInstance();
        Singleton1 singleton12 = Singleton1.getInstance();
        System.out.println(singleton11.equals(singleton12));

        System.out.println("懒汉式单例");
    }
}
